package cn.iocoder.yudao.module.system.dal.mysql.userpointslog;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.userpointslog.UserPointsLogDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.userpointslog.vo.*;

/**
 * 用户积分操作日志 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface UserPointsLogMapper extends BaseMapperX<UserPointsLogDO> {

    default PageResult<UserPointsLogDO> selectPage(UserPointsLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserPointsLogDO>()
                .eqIfPresent(UserPointsLogDO::getPoints, reqVO.getPoints())
                .eqIfPresent(UserPointsLogDO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserPointsLogDO::getOperate, reqVO.getOperate())
                .eqIfPresent(UserPointsLogDO::getSource, reqVO.getSource())
                .betweenIfPresent(UserPointsLogDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserPointsLogDO::getId));
    }

}